<?php

namespace IDock\Insurance\TPIC\Response;

use IDock\Http\Response;
use IDock\Insurance\TPIC\Response\AllTPICResponse;

class CommonResponse extends AllTPICResponse
{
    protected $code = '';

    protected $message = '';

    protected $data = '';

    public function resolve(): Response
    {
        return parent::resolve();
    }

    /**
     * @return string
     */
    public function getLogicCode(): string
    {
        $this->code = $this->get('state','');
        return $this->code;
    }

    /**
     * @return string
     */
    public function getMessage(): string
    {
        $this->message = $this->get('msg','');
        return $this->message;
    }


    /**
     * @return array
     */
    public function getData()
    {
        $this->data = $this->get('data',[]) ?: [];
        return $this->data;
    }


}
